//FA subsets
//$Id: subset.h 370 2010-03-14 13:49:32Z Oleg.Bulychov $
#pragma once

#include <iostream>
#include <algorithm>

#include "types.h"

class FA;

class States_Subset
{
private:
    std::vector<int> states_id_;
public:
    void insert(int const state_id);
    inline int const operator [](int const i) const { return states_id_[i]; };
    bool contains(int const state_id) const;

    inline void remove(int const state_id) { states_id_.erase(find(states_id_.begin(), states_id_.end(), state_id)); }  
    inline void clear()  { states_id_.clear(); }

    inline size_t size() const { return states_id_.size(); }
    inline bool empty()  const { return states_id_.empty(); }

    void intersect(States_Subset const& l, States_Subset const& r);
    void join(States_Subset const& l, States_Subset const& r);

    std::string to_String() const;
    std::string to_String(FA const& a) const;

    friend bool operator <=(States_Subset const& l, States_Subset const& r);
    friend bool operator ==(States_Subset const& l, States_Subset const& r);
    friend bool operator !=(States_Subset const& l, States_Subset const& r);
};

;

States_Subset operator *(States_Subset const& l, States_Subset const& r);
States_Subset operator +(States_Subset const& l, States_Subset const& r);

int FindInVector(std::vector<States_Subset> const& vs, States_Subset const& ss);


//EOF!
